package com.shu.spring;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author ssm
 * @version V1.0
 * @description:
 * @date 2020/12/10 20:20
 */
@Configuration
public class BeanDifinitionDemo {


    public static void main(String[] args) {

        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(BeanDifinitionDemo.class);

        UserService bean = context.getBean(UserService.class);
        System.out.println(bean);



    }


    @Bean
    public UserService getUserService(){
        System.out.println("0000");
        return new UserService();
    }

}
